<template>
  <div class="left_side">
    <div class="saas_avatar">
      <img
        src="https://image-c.weimobwmc.com/sass-admin/f866363f7c154be8a77dd4862a1406f8.png"
        alt=""
      />
    </div>
    <div class="saas_nav">
      <div class="saas_nav_con">
        <div
          :class="`nav_item ${item == 2 ? 'active' : ''}`"
          v-for="(item, index) in menuList"
          :key="item.id"
          @click="selectMenu(item, index)"
        >
          <a-icon type="money-collect" />
          <span>{{ item.name }}</span>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { mapState, mapMutations } from "vuex";
export default {
  data() {
    return {
      menuList: [
        { id: 1, name: "菜单一", icon: "appstore", route: "/manage/table" },
        { id: 2, name: "菜单二", icon: "appstore", route: "/manage/form" },
        { id: 3, name: "菜单三", icon: "appstore", route: "/manage/c" },
        { id: 4, name: "菜单四", icon: "appstore", route: "/manage/d" },
        { id: 5, name: "菜单五", icon: "appstore", route: "/manage/e" },
        { id: 6, name: "菜单六", icon: "appstore", route: "/manage/f" },
        { id: 7, name: "菜单七", icon: "appstore", route: "/manage/g" },
      ],
    };
  },
  methods: {
    selectMenu(item, index) {
      this.$router.push(item.route);
    },
  },
};
</script>
<style lang="scss" scoped>
.left_side {
  width: 120px;
  height: 100vh;
  background: #22242f;
  .saas_avatar {
    padding: 20px;
    margin: 0 20px;
    text-align: center;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    display: inline-block;
    img {
      width: 40px;
      height: 40px;
    }
  }
  .saas_nav {
    box-sizing: border-box;
    color: #757993;
    font-size: 14px;
    .nav_item {
      margin: 0 auto;
      padding: 11px 20px;
      position: relative;
      cursor: pointer;
      transition: 0.2s;
      span {
        margin-left: 5px;
      }
      &:hover {
        color: #fff;
        &::after {
          content: "";
          position: absolute;
          width: 4px;
          right: 10px;
          top: 25%;
          bottom: 25%;
          background: #fff;
          border-radius: 2px;
          color: #fff;
        }
      }
    }
    .active {
      color: #fff;
      &::after {
        content: "";
        position: absolute;
        width: 4px;
        right: 10px;
        top: 25%;
        bottom: 25%;
        background: #fff;
        border-radius: 2px;
        color: #fff;
      }
    }
  }
}
</style>